package com.springboot.mybatisplus;

import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import javax.sql.DataSource;

/**
 * @MapperScan :可以指定要扫描的Mapper接口
 * basePackages :可以指定多个包，这里我们就指定"com.springboot.mybatisplus.mapper"
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.springboot.mybatisplus.mapper"})
public class Application {
    public static void main(String[] args) {
        ConfigurableApplicationContext ioc =
                SpringApplication.run(Application.class, args);
        DataSource bean = ioc.getBean("dataSource", DataSource.class);
        System.out.println(bean.getClass());
    }
}
